<template>
    <div class="process-icon">

        <UxToolTip placement="top" v-if="isDtg" class="process-tip">
            <span name="dtg" />
            <em slot="content">Includes DTG printing</em>
        </UxToolTip>

        <UxToolTip placement="top" v-if="isEmb" class="process-tip">
            <span name="emb" />
            <em slot="content">Includes embroidery</em>
        </UxToolTip>

        <UxToolTip placement="top" v-if="isCustom" class="process-tip">
            <span name="custom" />
            <a slot="content" href="/document/help-center?classify=3&detail=95" target="_blank">Click to understand Custom layer</a>
        </UxToolTip>
    </div>
</template>
<script>
export default {
    props: {
        icons: { type: Array, default: () => [] },
    },
    data () {
        return {
            status: '',
            canvas: null,
            cache: {},
        };
    },
    computed: {
        isCustom () {
            return this.icons.find(i => i == 'custom')
        },
        isDtg () {
            return this.icons.find(i => i == 'dtg')
        },
        isEmb () {
            return this.icons.find(i => i == 'emb')
        },
    },

};
</script>

<style lang="scss" scoped>
.process-icon {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;

    .process-tip {
        margin-right: 6px;
        width: 20px;
        height: 20px;

        &::v-deep .popper-name {
            width: 100%;
            height: 100%;
        }

        span {
            display: block;
            width: 100%;
            height: 100%;
            padding: 1px;
            background: #ffffff;
            border: 1px solid #ebebeb;
            box-sizing: border-box;
            border-radius: 24px;
            position: relative;

            &::before {
                content: '';
                position: absolute;
                width: 16px;
                height: 16px;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                background-size: 100% 100%;
            }

            &[name='dtg']::before {
                background-image: url(@/assets/images/designer/designer-dtg.png);
            }
            &[name='emb']::before {
                background-image: url(@/assets/images/designer/designer-emb.png);
            }
            &[name='custom']::before {
                background-image: url(@/assets/images/designer/designer-custom.png);
            }
        }

        &::v-deep .popper-content {
            line-height: 32px;
            padding: 0 16px;
            background: #212121;
            border-radius: 6px;
            cursor: default;
        }

        em,
        a {
            white-space: nowrap;
            color: #fff;
            font-size: 12px;
            &::before {
                content: '';
                width: 0;
                height: 0;
                left: 50%;
                top: 100%;
                transform: translateX(-50%);
                border-top: 3px solid #212121;
                border-left: 4px solid transparent;
                border-right: 4px solid transparent;
                position: absolute;
            }
        }

        a {
            text-decoration: underline;
        }
    }
}
</style>
